<template>
  <h1>Cascader 示例</h1>
  <Demo :component="CascaderDemo2" />
  <Demo :component="CascaderDemo1" />
  <h2>Cascader Attributes</h2>
  <Table :dataSource="dataSource" :columns="columns" />
</template>

<script lang="ts">
import Demo from "./Demo/index.vue";
import Table from '../lib/table/Table.vue'
import CascaderDemo1 from "./Demo/CascaderDemo1.vue";
import CascaderDemo2 from "./Demo/CascaderDemo2.vue";
export default {
  components: {
    Demo,
    Table
  },
  setup() {
    const dataSource = [
      {
        id: 1,
        params: 'v-model:selected',
        illustrate: '选中项绑定值',
        type: '-',
        optional: '-',
        defaults: '-',
      },
      {
        id: 2,
        params: 'dataSource',
        illustrate: '可选项数据源,键名必须为name/children',
        type: 'array',
        optional: '-',
        defaults: '-',
      },
      {
        id: 3,
        params: 'popoverHeight',
        illustrate: '自定义弹出框高度',
        type: 'string',
        optional: '-',
        defaults: '200px',
      },
      {
        id: 4,
        params: 'loadData',
        illustrate: '加载动态数据的方法',
        type: 'function',
        optional: '-',
        defaults: '-',
      },
    ]

    const columns = [
      { title: '参数', prop: 'params', width: '300' },
      { title: '说明', prop: 'illustrate', width: '300' },
      { title: '类型', prop: 'type', width: '100' },
      { title: '可选值', prop: 'optional', width: '100' },
      { title: '默认值', prop: 'defaults' },
    ]
    return { CascaderDemo1, CascaderDemo2, dataSource, columns };
  },
};
</script>

<style></style>
